package com.xx.interceptor.util;

import sun.misc.BASE64Decoder;

import java.io.File;
import java.io.UnsupportedEncodingException;

public class TestMain {

    public static void main(String[] args) {
        String data = "0351266}??m?????x?^<????(?)ek.???{???'v?\"w?????";
        data = data.substring(0,data.lastIndexOf("}")+1);
        System.out.println("最终data=="+data);

//        File file = new File("C:\\tmp\\xx\\read.txt");
//        String str = FileUtil.realTxt(file);
//        try {
//            String preData = "";
//            if (str.contains("%")){
//                preData = java.net.URLDecoder.decode(str, "utf-8");
//            }else{
//                preData = str;
//            }
//
////            System.out.println("preData=="+preData);
//            BASE64Decoder decoder = new BASE64Decoder();
//            String data=new String(decoder.decodeBuffer(preData), "UTF-8");
////            System.out.println("predata=="+data);
////            String resdata = new String (data.getBytes("ISO-8859-1"),"UTF-8");
////            data=new String(decoder.decodeBuffer(data), "UTF-8");
//            System.out.println("最终data=="+data);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }
}
